package com.jlpay.openapi.demo.ledger.bill;

import com.jlpay.open.jlpay.sdk.java.model.ledger.request.BillApplyUrlRequest;
import com.jlpay.open.jlpay.sdk.java.model.ledger.response.BillApplyUrlResponse;
import com.jlpay.open.jlpay.sdk.java.utils.json.JsonUtils;
import com.jlpay.openapi.demo.JlpayOpenApiService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *
 * @author dengwenning
 * @since 2024/8/30
 **/
public class BillApplyUrlService {

    private static final Logger LOGGER = LoggerFactory.getLogger(BillApplyUrlService.class);

    public static void main(String[] args) {
        BillApplyUrlRequest billApplyUrlRequest = buildBillApplyUrlRequest();
        BillApplyUrlResponse billApplyUrlResponse = JlpayOpenApiService.openMerchService()
                .post(billApplyUrlRequest, BillApplyUrlResponse.class);
        LOGGER.info("分账账单下载响应:{}", JsonUtils.toString(billApplyUrlResponse));
    }

    private static BillApplyUrlRequest buildBillApplyUrlRequest() {
        BillApplyUrlRequest billApplyUrlRequest = new BillApplyUrlRequest();
        billApplyUrlRequest.setOrgCode("50720711");
        billApplyUrlRequest.setBillDate("2024-08-15");
        return billApplyUrlRequest;
    }
}
